package com.itheima.arithmeticoprator;

public class ArithmeticoperatorDemo6 {

    public static void main(String[] args) {
        // +=
        // 规则：将左边和右边进行相加，然后再把结果赋值给左边
        int a = 10;
        int b = 20;
        a += b;
        System.out.println(a); // 10
        System.out.println(b); // 20

        // 细节：
        // +=、-=、*=、/= 底层都隐藏一个强制类型转换
        short s = 1;
        // 下面代码等同于：s = (short)(s + 1)
        s += 1;
        System.out.println(s);
    }
}
